package thread_case;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class ThreadDemo7 {
    public static void main(String[] args) {
        // ExecutorService 提供了一种管理和控制异步任务执行的方式
        ExecutorService service = Executors.newFixedThreadPool(4);
        // 使用 submit 方法把任务添加到线程池中
        service.submit(new Runnable() {
            @Override
            public void run() {
                System.out.println("hello");
            }
        });
    }
}
